#include <cstdio>

int main()
{
    int i, t, s;
    long long n;
    scanf("%d", &t);
    while (t--)
    {
        scanf("%lld", &n);
        s = 0;
        while (n / 5)
        {
            s += n / 5;
            n /= 5;
        }
        printf("%d\n", s);
    }
}